<SCRIPT>
function updateSched() {
	
	var sched="";
	var lun =document.getElementById("CiutimetableLunes").checked;
	var mar =document.getElementById("CiutimetableMartes").checked;
	var mie =document.getElementById("CiutimetableMiercoles").checked;
	var jue =document.getElementById("CiutimetableJueves").checked;
	var vie =document.getElementById("CiutimetableViernes").checked;
	var sab	=document.getElementById("CiutimetableSabados").checked;
	
  var horadesdeindex=document.getElementById("CiutimetableHoradesde").value;
  var horadesde = document.getElementById("CiutimetableHoradesde").options[horadesdeindex].text;
  
  var horahastaindex=document.getElementById("CiutimetableHorahasta").value;
  var horahasta = document.getElementById("CiutimetableHorahasta").options[horahastaindex].text;
  if(lun){
    sched="Lunes";
  }
	if(mar){
		sched=sched+" "+"Martes";
	}
	if(mie){
		sched=sched+" "+"Miercoles";
	}
	if(jue){
		sched=sched+" "+"Jueves";
	}
	if(vie){
		sched=sched+" "+"Viernes";
	}
	if(sab){
		sched=sched+" "+"Sabados";
	}
    if(horadesdeindex>0){
        sched=sched+" "+horadesde;
    }
    if(horahastaindex>0){
        sched=sched+"-"+horahasta;
    }
	document.getElementById("CiutimetableName").value = sched;	
}
</SCRIPT>


<?php echo $this->Form->input("Lunes",array('type'=>'checkbox','onClick'=>'javascript:updateSched()') ); ?>
	<?php echo $this->Form->input("Martes",array('type'=>'checkbox','onClick'=>'javascript:updateSched()') ); ?>
	<?php echo $this->Form->input("Miercoles",array('type'=>'checkbox','onClick'=>'javascript:updateSched()') ); ?>
	<?php echo $this->Form->input("Jueves",array('type'=>'checkbox','onClick'=>'javascript:updateSched()') ); ?>
	<?php echo $this->Form->input("Viernes",array('type'=>'checkbox','onClick'=>'javascript:updateSched()') ); ?>
	<?php echo $this->Form->input("Sabados",array('type'=>'checkbox','onClick'=>'javascript:updateSched()') ); ?>
	
	<?php echo $this->Form->input("horadesde",array('options'=>
        array(0=>'Desde',1 =>'06'
                        ,2 =>'07'
                        ,3 =>'08'
                        ,4 =>'09'
                        ,5 =>'10'
                        ,6 =>'11'
                        ,7 =>'12'
                        ,8 =>'13'
                        ,9 =>'14'
                        ,10=>'15'
                        ,11=>'16'
                        ,12=>'17'
                        ,13=>'18'
                        ,14=>'19'
                        ,15=>'20'
                        ,16=>'21'),
       'onChange'=>'javascript:updateSched()') ); ?>
      
  <?php echo $this->Form->input("horahasta",array('options'=>
         array(0=>'Hasta',1 =>'07'
                         ,2 =>'08'
                         ,3 =>'09'
                         ,4 =>'10'
                         ,5 =>'11'
                         ,6 =>'12'
                         ,7 =>'13'
                         ,8 =>'14'
                         ,9 =>'15'
                         ,10=>'16'
                         ,11=>'17'
                         ,12=>'18'
                         ,13=>'19'
                         ,14=>'20'
                         ,15=>'21'
                         ,16=>'22'),
         'onChange'=>'javascript:updateSched()') ); ?>